﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Trans.customer
{
    public partial class CQuery_customer : Form
    {
        static int index_detail ;
        public CQuery_customer()
        {
            InitializeComponent();
            index_detail=gv_customer.Columns["bt_detail"].Index;
        }

        private void CQuery_customer_Load(object sender, EventArgs e)
        {        
        }

        private void bt_query_Click(object sender, EventArgs e)
        {
            this.vw_customerTableAdapter.FillByQStr(this.dataSet_view.vw_customer,tx_qstr.Text.Trim());
            session.Color_Const.set_gv_color(gv_customer);
        }

        private void gv_customer_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if(index_detail==e.ColumnIndex)
                    {
                        Detail_customer f = new Detail_customer((int)gv_customer.Rows[e.RowIndex].Cells["c_id"].Value);
                        f.ShowDialog();
                    }
            }
        
    

        private void bt_cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        }
    }
